<body class="wy-body">
<div class="layui-fluid">
	<div class="layui-card">
		<div class="layui-form layui-card-header wy-card-header-auto">
			<div class="layui-form-item">
				<form action="{:url(request()->action())}" method="get">
				<div class="layui-inline">
					<label class="layui-form-label wy-width-auto">角色名称</label>
					<div class="layui-input-inline">
						<input type="text" name="name" placeholder="请输入" autocomplete="off" class="layui-input" value="{$get_data.name}">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label wy-width-auto">状态</label>
					<div class="layui-input-inline">
						<select name="status">
							<option value="">--请选择--</option>
							<option value="1" {if $get_data.status == '1'} selected {/if}>正常</option>
							<option value="0" {if $get_data.status == '0'} selected {/if}>禁用</option>
						</select>
					</div>
				</div>
				<div class="layui-inline">
					<button class="layui-btn">
						<i class="layui-icon layui-icon-search"></i>
					</button>
				</div>
				</form>
			</div>
		</div>

		<div class="layui-card-body">
			<div style="padding-bottom: 10px;">
				<button class="layui-btn wy_but"
					wy-event="lay_parent_tab"
					wy-url="{:url('add')}"
					wy-id="adminrole_info"
					wy-title="添加角色"
				>添加</button>
			</div>
<table class="layui-table" name="wy_table_lists" lay-filter="wy_table_lists"
	lay-data="{
		height:'full-168',
		cellMinWidth:'180',
		url:'{:url('ajax_lists')}',
		where: {
				{$get_str}
			},
		method:'post',
		page:true,
		id:'wy_table_lists',
		limits:[15,30,50,100]}"
>
<thead>
<tr>
	<th lay-data="{field:'id'}">ID</th>
	<th lay-data="{field:'name'}">角色名称</th>
	<th lay-data="{field:'info'}">角色描述</th>
	<th lay-data="{templet:'#show_num'}">人数</th>
	<th lay-data="{templet:'#statusTool'}">状态</th>
	<th lay-data="{toolbar:'#barTool'}">操作</th>
</tr>
</thead>
</table>

		</div>
	</div>
</div>
<script type="text/html" id="statusTool">
{{# if(d.status == 1){ }}
	<span class="layui-btn layui-btn-xs layui-btn-success">正常</span>
{{# }else{ }}
	<span class="layui-btn layui-btn-xs layui-btn-disabled">禁用</span>
{{# } }}
</script>
<script type="text/html" id="show_num">
    <a class="layui-table-link wy_but" 
		wy-url="{:url('Adminuser/index')}?role_id={{d.id}}" 
		wy-event="lay_parent_tab"
		wy-id="adminuser_index"
		wy-title="管理员管理"
	>{{d.num}}</a>
</script>
<script type="text/html" id="barTool">
<div class="layui-btn-group">
	<a class="layui-btn layui-btn-xs layui-btn-primary wy_but"
		wy-event="lay_parent_tab"
		wy-url="{:url('edit')}?id={{d.id}}"
		wy-id="adminrole_info"
		wy-title="编辑角色"
	>编辑</a>

	<a class="layui-btn layui-btn-xs layui-btn-primary wy_but" 
		wy-event="lay_ajax_get"
		wy-url="{:url('del')}?id={{d.id}}"
		wy-tips="确认是否删除该信息，删除以后将无法恢复"
		wy-table="wy_table_lists"
	>删除</a>
</div>
</script>
</body>